Skip to content

Feature/capr 26 port privacy policy command - #60

Merged
shamikkarkhanis merged 8 commits into
developfrom
feature/capr-26-port-privacy-policy-command
Feb 6, 2026
Merged

Feature/capr 26 port privacy policy command#60
shamikkarkhanis merged 8 commits into
developfrom
feature/capr-26-port-privacy-policy-command

Conversation

@belofe

@belofe belofe commented Feb 3, 2026

Copy link
Copy Markdown

Add privacy command

Summary by Sourcery

Add a new Discord cog that exposes a /privacy slash command for viewing the bot's privacy policy and data handling information.

New Features:

  • Introduce a Privacy cog that presents privacy policy and data handling details via an embedded Discord message.
  • Add a /privacy slash command that returns privacy, storage, access, and deletion information as an ephemeral response to users.

@sourcery-ai

sourcery-ai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new Discord cog that exposes a /privacy slash command to display the bot’s privacy policy and data handling information via an ephemeral embed.

Sequence diagram for the new /privacy slash command flow

sequenceDiagram
    actor User
    participant DiscordClient as Discord_client
    participant Bot as Discord_bot
    participant Privacy as Privacy_cog

    User->>DiscordClient: Trigger /privacy command
    DiscordClient->>Bot: InteractionCreate event
    Bot->>Privacy: privacy(interaction)
    Privacy->>Privacy: Build privacy policy embed
    Privacy->>Bot: interaction.response.send_message(embed, ephemeral=True)
    Bot->>DiscordClient: Send ephemeral response
    DiscordClient-->>User: Display privacy policy embed
Loading

Class diagram for the new Privacy cog

classDiagram
    class Bot

    class Privacy {
        - bot Bot
        - log Logger
        + Privacy(bot Bot)
        + privacy(interaction Interaction) async
    }

    class Interaction
    class Logger

    Bot <|.. Privacy : uses
    Privacy ..> Interaction : handles
    Privacy ..> Logger : logs
Loading

File-Level Changes

Change Details Files
Introduce a Privacy cog that provides a /privacy slash command showing an embedded privacy policy.
  • Create a new Discord cog class that logs initialization and stores the bot reference.
  • Register a slash command named 'privacy' using app_commands that responds to interactions with an ephemeral embed.
  • Construct a rich embed including sections for collected data, storage, access/usage, and deletion procedures, with footer metadata.
  • Expose an async setup function to register the cog with the bot.
capy_discord/exts/tools/privacy.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In the 👥 Data Access embed field, the concatenated strings for the last sentence lack a space between "third parties" and "or used", resulting in "third partiesor used" in the rendered text; add a trailing space to the first string or a leading space to the second.
  • The privacy policy content and the Last updated: February 2024 footer are hard-coded in the cog; consider centralizing this text (and date) in a configuration or constants module so the policy can be updated without code changes and stays consistent across commands.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `👥 Data Access` embed field, the concatenated strings for the last sentence lack a space between `"third parties"` and `"or used"`, resulting in `"third partiesor used"` in the rendered text; add a trailing space to the first string or a leading space to the second.
- The privacy policy content and the `Last updated: February 2024` footer are hard-coded in the cog; consider centralizing this text (and date) in a configuration or constants module so the policy can be updated without code changes and stays consistent across commands.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@shamikkarkhanis

Copy link
Copy Markdown
Member
  1. Fix the empty field value in the "never shared" section to prevent the Discord API from rejecting the message.
  2. Update the hardcoded footer date to February 2026 to ensure the policy appears current.
  3. Replace the \n field names with descriptive headers to improve the visual polish and structure of the embed.
  4. Move the static policy text into constants to improve code readability and simplify future text updates

@shamikkarkhanis
shamikkarkhanis merged commit 7093854 into develop Feb 6, 2026
4 checks passed
@shamikkarkhanis
shamikkarkhanis deleted the feature/capr-26-port-privacy-policy-command branch February 6, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants